#pragma once
#include "transaction.h"
#include <iostream>
#include <list>
#include <string>

//@author A0086933U
using namespace std;

class History
{
private:
	list<Transaction*> _listOfTransaction;
	int _noOfTransaction;
	double _totalExpense;
	double _totalIncome;
public:
	History();
	~History(void);
	
	//getter
	int getNoOfTransaction();
	Transaction* getNth(int);
	double getTotalExpense();
	double getTotalIncome();
	list<Transaction*>* getTransList();

	//functions
	bool coutAll();
	bool checkDuplicate(Transaction*);
	bool add(Transaction*);
	History merge(History*);
	bool remove(Transaction*);
	int remove(History*);
	bool clear();

	//filters
	History filterCategory(string category);//by category
	History filterDate(struct dateTime DTStart, struct dateTime DTEnd);//by date
	History filterAccount(string account);//by account
	History filterAmount(double low, double high); //by amount
	History filterType(int);//by type
	
	//History& operator=(History&);
};

